package com.example.gymmanagement.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 
 * @TableName rent
 */
@TableName(value ="rent")
@Data
public class Rent implements Serializable {
    /**
     * 租用id
     */
    @TableId(value = "rent_id",type=IdType.AUTO)
    private Long rentId;

    /**
     * 租用用户
     */
    @TableField(value = "rent_user")
    private Long rentUser;

    /**
     * 租用开始时间
     */
    @TableField(value = "rent_start")
    private LocalDateTime rentStart;

    /**
     * 租用结束时间
     */
    @TableField(value = "rent_end")
    private LocalDateTime rentEnd;

    /**
     * 每小时单价
     */
    @TableField(value = "rent_price")
    private Double rentPrice;

    /**
     * 租用器材id
     */
    @TableField(value = "rent_equip")
    private Long rentEquip;

    /**
     * 租用场地id
     */
    @TableField(value = "rent_field")
    private Long rentField;

    /**
     * 租用比赛id
     */
    @TableField(value = "rent_match")
    private Long rentMatch;

    /**
     * 租用类型（预约、比赛预约、校队预约）
     */
    @TableField(value = "rent_type")
    private String rentType;

    /**
     * 租用详情
     */
    @TableField(value = "rent_dtail")
    private String rentDtail;

    /**
     * 租用状态（预约中、进行中、已完成）
     */
    @TableField(value = "rent_status")
    private String rentStatus;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Rent other = (Rent) that;
        return (this.getRentId() == null ? other.getRentId() == null : this.getRentId().equals(other.getRentId()))
            && (this.getRentUser() == null ? other.getRentUser() == null : this.getRentUser().equals(other.getRentUser()))
            && (this.getRentStart() == null ? other.getRentStart() == null : this.getRentStart().equals(other.getRentStart()))
            && (this.getRentEnd() == null ? other.getRentEnd() == null : this.getRentEnd().equals(other.getRentEnd()))
            && (this.getRentPrice() == null ? other.getRentPrice() == null : this.getRentPrice().equals(other.getRentPrice()))
            && (this.getRentEquip() == null ? other.getRentEquip() == null : this.getRentEquip().equals(other.getRentEquip()))
            && (this.getRentField() == null ? other.getRentField() == null : this.getRentField().equals(other.getRentField()))
            && (this.getRentMatch() == null ? other.getRentMatch() == null : this.getRentMatch().equals(other.getRentMatch()))
            && (this.getRentType() == null ? other.getRentType() == null : this.getRentType().equals(other.getRentType()))
            && (this.getRentDtail() == null ? other.getRentDtail() == null : this.getRentDtail().equals(other.getRentDtail()))
            && (this.getRentStatus() == null ? other.getRentStatus() == null : this.getRentStatus().equals(other.getRentStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRentId() == null) ? 0 : getRentId().hashCode());
        result = prime * result + ((getRentUser() == null) ? 0 : getRentUser().hashCode());
        result = prime * result + ((getRentStart() == null) ? 0 : getRentStart().hashCode());
        result = prime * result + ((getRentEnd() == null) ? 0 : getRentEnd().hashCode());
        result = prime * result + ((getRentPrice() == null) ? 0 : getRentPrice().hashCode());
        result = prime * result + ((getRentEquip() == null) ? 0 : getRentEquip().hashCode());
        result = prime * result + ((getRentField() == null) ? 0 : getRentField().hashCode());
        result = prime * result + ((getRentMatch() == null) ? 0 : getRentMatch().hashCode());
        result = prime * result + ((getRentType() == null) ? 0 : getRentType().hashCode());
        result = prime * result + ((getRentDtail() == null) ? 0 : getRentDtail().hashCode());
        result = prime * result + ((getRentStatus() == null) ? 0 : getRentStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", rentId=").append(rentId);
        sb.append(", rentUser=").append(rentUser);
        sb.append(", rentStart=").append(rentStart);
        sb.append(", rentEnd=").append(rentEnd);
        sb.append(", rentPrice=").append(rentPrice);
        sb.append(", rentEquip=").append(rentEquip);
        sb.append(", rentField=").append(rentField);
        sb.append(", rentMatch=").append(rentMatch);
        sb.append(", rentType=").append(rentType);
        sb.append(", rentDtail=").append(rentDtail);
        sb.append(", rentStatus=").append(rentStatus);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}